test(NODE-7458): sync server selection deprioritization tag spec tests#4886
Merged
test(NODE-7458): sync server selection deprioritization tag spec tests#4886
Conversation
Contributor
Author
|
CI failures are unrelated |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR syncs server-selection “deprioritized server” tag-set spec tests for ReplicaSetWithPrimary and ReplicaSetNoPrimary topologies, aligning the Node driver’s spec fixture set with the upstream coverage for “only matching tags” scenarios.
Changes:
- Added “OnlyMatchingTags” server selection logic fixtures for
ReplicaSetWithPrimaryread preferences (Nearest/Secondary/SecondaryPreferred/PrimaryPreferred). - Added corresponding “OnlyMatchingTags” fixtures for
ReplicaSetNoPrimaryread preferences (Nearest/Secondary/SecondaryPreferred/PrimaryPreferred). - Provided both YAML and JSON representations for each new scenario (consistent with existing spec fixture patterns in this repo).
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.yml | Adds YAML fixture for SecondaryPreferred where only tag-matching secondary is deprioritized (primary fallback). |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.json | JSON version of the above fixture (used by Node’s spec runner). |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.yml | Adds YAML fixture for Secondary where only tag-matching secondary is deprioritized (must still be selected). |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.json | JSON version of the above fixture. |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.yml | Adds YAML regression fixture for PrimaryPreferred where the matching primary is deprioritized but must still be selected. |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.json | JSON version of the above fixture. |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedNearestOnlyMatchingTags.yml | Adds YAML fixture for Nearest where only tag-matching server is deprioritized (must still be selected). |
| test/spec/server-selection/server_selection/ReplicaSetWithPrimary/read/DeprioritizedNearestOnlyMatchingTags.json | JSON version of the above fixture. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.yml | Adds YAML fixture for SecondaryPreferred in a no-primary topology where only tag-matching secondary is deprioritized. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryPreferredOnlyMatchingTags.json | JSON version of the above fixture. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.yml | Adds YAML fixture for Secondary where only tag-matching secondary is deprioritized. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedSecondaryOnlyMatchingTags.json | JSON version of the above fixture. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.yml | Adds YAML fixture for PrimaryPreferred in a no-primary topology where only tag-matching secondary is deprioritized. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedPrimaryPreferredOnlyMatchingTags.json | JSON version of the above fixture. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedNearestOnlyMatchingTags.yml | Adds YAML fixture for Nearest in a no-primary topology where only tag-matching secondary is deprioritized. |
| test/spec/server-selection/server_selection/ReplicaSetNoPrimary/read/DeprioritizedNearestOnlyMatchingTags.json | JSON version of the above fixture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nbbeeken
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
NODE-7458
Summary of Changes
Sync server-selection tag tests for ReplicaSetNoPrimary and ReplicaSetWithPrimary
Double check the following
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript